if [ $# -lt 2 ] 
then
  echo "input parameter password and database name"
  echo "eg. ./$0 123456 test"
else
  echo "create tables ..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<create_table.sql

  echo "initialize dictionary..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<dictionary.sql
  echo "initialize area..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<area.sql
  echo "initialize ipAddress..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<init_ipAddress.sql
  echo "initialize market..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<market.sql
  echo "initialize service..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<service.sql
 
  echo "initialize partcategory..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<init_partcategory.sql
  echo "initialize stdpartname..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<init_stdpartname.sql
  echo "initialize measurementUnit..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<measurementUnit.sql
  echo "initialize carModel..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<init_carModel.sql
  echo "initialize part..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<init_part.sql

  echo "expand part..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<init_part2.sql
  
  echo "initialize permission..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<permission.sql
  echo "initialize permissiondependence..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<permissiondependence.sql
  echo "initialize permissionservice..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<permissionservice.sql

  echo "initialize action..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<action.sql
  echo "initialize jsmodule..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<jsmodule.sql

  echo "initialize desktop..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<desktop.sql
  echo "initialize desktoptarget..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<desktoptarget.sql
  echo "initialize desktopmenu..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<desktopmenu.sql
  echo "initialize desktopjsmodule..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<desktopjsmodule.sql

  
  echo "initialize package..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<package.sql
  echo "initialize packagecompanytype..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<packagecompanytype.sql
  echo "initialize packageservice..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<packageservice.sql

  echo "initialize roletemplate..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<roletemplate.sql
  echo "initialize roletemplatepermission..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<roletemplatepermission.sql
  echo "initialize roletemplatetarget..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<roletemplatetarget.sql

  echo "initialize uec3company..."
  mysql --default-character-set=utf8 -u root --password=$1 -D $2<uec3company.sql
fi
